home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / dev / gg / gengetopt-2.6.lha / gengetopt-2.6 / src / Makefile.am < prev    next >
Makefile  |  2001-12-17  |  3KB  |  69 lines

  1. # Copyright (C) 1999, 2000, 2001  Free Software Foundation, Inc.
  2. #  
  3. # This file is part of GNU gengetopt 
  4. #
  5. # GNU gengetopt is free software; you can redistribute it and/or modify 
  6. # it under the terms of the GNU General Public License as published by 
  7. # the Free Software Foundation; either version 2, or (at your option) 
  8. # any later version. 
  9. #
  10. # GNU gengetopt is distributed in the hope that it will be useful, but 
  11. # WITHOUT ANY WARRANTY; without even the implied warranty of 
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  13. # Public License for more details. 
  14. #
  15. # You should have received a copy of the GNU General Public License along 
  16. # with gengetopt; see the file COPYING. If not, write to the Free Software 
  17. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
  18.  
  19. SUFFIXES = .text
  20.  
  21. .text.o:
  22.     $(TXTC) $<
  23.  
  24. bin_PROGRAMS = gengetopt
  25.  
  26. gengetopt_SOURCES = copyright.text reportbugs.text parser.y scanner.l \
  27.                     argsdef.c cmdline.c gengetopt.c gm.c yyerror.c \
  28.                     gengetopt_strdup.text
  29.  
  30. gengetopt_LDADD = @LIBOBJS@ @LEXLIB@
  31.  
  32. EXTRA_DIST = parser.h argsdef.h gengetopt.h ggos.h gm.h getopt.h \
  33.              cmdline.ggo cmdline.h cxxconfig.h
  34.  
  35. PROGNAME = $(top_builddir)/src/gengetopt$(EXEEXT)
  36.  
  37. # it may happen, usually if the sources have been downloaded from CVS
  38. # repository, that cmdline.ggo is more recent than cmdline.c, but
  39. # cmdline.c cannot be re-generated, even because gengetopt has
  40. # to be built first. For instance if you only change spaces in cmdline.ggo
  41. # cmdline.c will not be different, and thus it is not updated in the CVS
  42. # repository; then when you make a checkout on another place, make
  43. # would try to build cmdline.c, but to do this it would need gengetopt
  44. # which is not built yet; so we simply touch cmdline.c (and this is safe)
  45. %.c: %.ggo
  46.     if test -f $(PROGNAME); then \
  47.     $(PROGNAME) --input=$< --no-handle-version --no-handle-help \
  48.         --no-handle-error; \
  49.     else touch $@ ; fi
  50.  
  51. # automatically generate gengetopt_strdup() from the replacement function
  52. # strdup().
  53. gengetopt_strdup.text: strdup.c
  54.     echo "/* gengetopt_strdup(): automatically generated from strdup.c. */" > $@
  55.     cat $< | sed -e 's/^strdup (/gengetopt_&/' \
  56.                -e 's/^char \* *$$/static &/' \
  57.                -e '/^#include.*$$/D' -e '/^$$/D' >> $@
  58.  
  59. # we distribute these files because who uses gengetopt might need them
  60. # these are installed in $(prefix)/share/gengetopt
  61. pkgdata_DATA = getopt.h getopt.c getopt1.c
  62.  
  63. # yywrap.c is added only if it is not found on lex (flex) lib, and will be
  64. # added automatically by automake
  65.  
  66. # automake (maybe due to a bug) doesn't added these files well,
  67. # so we explicitely declare them
  68. MAINTAINERCLEANFILES = scanner.c parser.h parser.c gengetopt_strdup.text
  69.